﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyCalManager.Data;

namespace MyCalManager.Model
{
    public class Day
    {

        public int ID { get; set; }
        public int UserID { get; set; }
        public DateTime Timekey { get; set; }
        public decimal Gewicht { get; set; }
        public decimal SumKal { get; set; }
        public decimal SumWWPoints { get; set; }
        public string StringTimekey { get; set; }


        public DAYS ToDAYS()
        {
            DAYS ret = new DAYS();
            ret.ID = this.ID;
            ret.UserID = this.UserID;
            ret.Timekey = this.Timekey;
            ret.Gewicht = this.Gewicht;
            ret.Kal = this.SumKal;
            ret.WWPoints = this.SumWWPoints;

            return ret;
        }

        public DAYS UpdateChanges(DAYS Orig)
        {
            if (Orig.Gewicht != this.Gewicht)
            {
                Orig.Gewicht = this.Gewicht;
            }
            if (Orig.Kal != this.SumKal)
            {
                Orig.Kal = this.SumKal;
            }
            if (Orig.WWPoints != this.SumWWPoints)
            {
                Orig.WWPoints = this.SumWWPoints;
            }
            if (Orig.Timekey != this.Timekey)
            {
                Orig.Timekey = this.Timekey;
            }
            return Orig;
        }

       
    }

    
}
